//轮播图路径
var arr = new Array("image/g1.jpg", "image/g2.jpg", "image/g3.jpg",
    "image/g4.jpg", "image/g5.jpg", "image/g6.jpg");
var i = 0;
$(document).ready(function () {
    $(".lunList>li").click(function () {
        i = $(this).val();
        $(".lunImg").attr("src", "/statics/" + arr[i]);
    });
});

//轮播图代码
var flag = false;
var id = setInterval(function () {
    if (i < 5 && flag == false) {
        xia();
    } else if (i >= 5 || flag == true) {
        shang();
    }
}, 3000);


function shang() {
    i--;
    if (i <= 0) {
        i = 0;
        flag = false;
    }
    $(".lunImg").attr("src", "/statics/" + arr[i]);
}

function xia() {
    i++;
    if (i >= 5) {
        i = 5;
        flag = true;
    }
    $(".lunImg").attr("src", "/statics/" + arr[i]);
}
// 跳转

//function login() {
//	location.href = "login.jsp";
//}

function register() {
    window.location.href = "/tj/register";
}

function vip() {
    window.location.href = "/tj/vip";
}

function jm() {
    window.location.href = "/tj/jm";
}

function index() {
    window.location.href = "/tj/index";
}

function select() {
    window.location.href = "/tj/toselect";
}